package org.dromara.kitchen.service;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.dromara.common.core.exception.TransactionalException;
import org.dromara.kitchen.domain.product.Product;

import com.baomidou.mybatisplus.extension.service.IService;

import java.util.Map;

/**
 * 商品Service接口
 *
 * @author Mr.Zhou
 * @date 2024-10-21
 */
public interface IProductService extends IService<Product>{

    /**
     *  编辑商品信息
     * @param product
     * @return
     * @throws TransactionalException
     */
    int addProduct(Product product) throws TransactionalException;

    /**
     * 商品详情
     * @param id 商品id
     * @return ProductVo
     */
    Product goodsDetail(Long id);


    /**
     * 获取生成的属性
     * @param id 商品id
     * @param jsonStr jsonStr
     * @return map
     */
    Map<String,Object> getFormatAttr(Long id, String jsonStr, boolean isActivity, Integer isReset);

    /**+
     * 删除商品转发海报
     * @param id
     */
    void deleteForwardImg(Long id);


    Page<Product> selectPageList(Page<Product> page, Map<String,Object> map);
}
